<!DOCTYPE html>
<@compress single_line=isCompress>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>${platform} - <#if (art.id)?? >编辑<#else>发布</#if>文章-${typeName}</title>
    <#include "/pager/common/quote.ftl" />
    <link rel="stylesheet" href="${root}/assets/common/kindeditor/themes/default/default.css" />
	<link rel="stylesheet" href="${root}/assets/common/kindeditor/plugins/code/prettify.css" />
	<script charset="utf-8" src="${root}/assets/common/kindeditor/kindeditor-all-min.js"></script>
	<script charset="utf-8" src="${root}/assets/common/kindeditor/lang/zh-CN.js"></script>
	<!-- batch-upload -->
   <link rel="stylesheet" href="${root}/assets/common/vendors/jquery-batch-file-upload/css/jquery.fileupload-ui.css">
   <!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
   <script src="${root}/assets/common/vendors/jquery-batch-file-upload/js/vendor/jquery.ui.widget.js"></script>
   <!-- The Templates plugin is included to render the upload/download listings -->
   <script src="${root}/assets/common/vendors/jquery-file-upload/js/vendor/tmpl.min.js"></script>
   <!-- The Load Image plugin is included for the preview images and image resizing functionality -->
   <script src="${root}/assets/common/vendors/jquery-file-upload/js/vendor/load-image.min.js"></script>
   <!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
   <script src="${root}/assets/common/vendors/jquery-batch-file-upload/js/jquery.iframe-transport.js"></script>
   <!-- The basic File Upload plugin -->
   <script src="${root}/assets/common/vendors/jquery-batch-file-upload/js/jquery.fileupload.js"></script>
   <!-- The File Upload file processing plugin -->
   <script src="${root}/assets/common/vendors/jquery-batch-file-upload/js/jquery.fileupload-fp.js"></script>
   <!-- The File Upload user interface plugin -->
   <script src="${root}/assets/common/vendors/jquery-batch-file-upload/js/jquery.fileupload-ui.js"></script>
   <!-- The localization script -->
   <script src="${root}/assets/common/vendors/jquery-batch-file-upload/js/locale.js"></script>
   <!-- The main application script -->
   <script src="${root}/assets/common/vendors/jquery-batch-file-upload/js/main.js"></script>
   <!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ -->
   <!--[if gte IE 8]><script src="${root}/assets/common/vendors/jquery-batch-file-upload/js/cors/jquery.xdr-transport.js"></script><![endif]-->
   <!-- batch-upload -->	
	<link rel="stylesheet" href="${root}/assets/common/uploadify/uploadify.css" />
	<script type="text/javascript" src="${root}/assets/common/uploadify/jquery.uploadify.min.js"></script>
	<script type="text/javascript" src="${root}/assets/biz-logic/js/common/file.upload.file.js"></script>
	<link rel="stylesheet" href="${root}/assets/biz-logic/css/common/common.css"/>
	
<script type="text/javascript">
	var global = {
		type : "${type}",
		recommend : "${(art.recommend)!''}",
		spaceShow : "${(art.spaceShow)!''}",
		sysFid : "${(art.fId)!}",
		fileId : "${(art.videoUrl)!}",   //视频文件ID
		aid : "${(art.id)!}",
		isDeleteAll : false,
		isBatchDelBtn : false,
		chkdCount : 0
	};
	$(function(){
		$("#recommend").val(global.recommend);
		$("#spaceShow").val(global.spaceShow);
		//解决Chrome加载插件崩溃
		setTimeout(function(){
			$("#file_upload").uploadify({
			 	auto     : true,
			 	button_image_url : "",
			 	fileObjName : 'videoUrlTmp',
			 	buttonText:"+ 添加文件",
		        height        : 30,
		        swf           : "${root}/assets/common/uploadify/uploadify.swf",
		        uploader      : "${base + '/document/upload-article_imgs.do?fileModule=${type}_video'}",
		        width         : 80,
		        uploadLimit : 1000000000000,
		        fileSizeLimit : "100MB",
		        fileTypeExts : '*.flv;*.mp4;*.mov;*.f4v;*.3gp;',    
		        onUploadSuccess:function(file,result){
		        	$("#file_upload-queue").html("");
		        	fillVal(result);
		        } 
			});
		},10);
	});
	window.onbeforeunload = function(){
		clearFids(global.aid==""?true:false);
		if(fileUpload.isDel){
			fileUpload.del("cancel");
		}
	}; 
</script>
</head>
<body>
    <#include "/pager/biz-logic/include/top.ftl" />
<div id="page-wrapper"><!--END PAGE HEADER & BREADCRUMB--><!--BEGIN CONTENT-->
<div class="page-content">
    <div id="tab-general">
        <div class="row">
            <div class="col-lg-12">
                <div class="portlet">
                    <div class="portlet-header">
                        <div class="caption"><#if (art.id)?? >编辑<#else>发布</#if>文章-${typeName}</div>
                    </div>
                    <div class="portlet-body">
                        <div class="table-tools">
                            <div class="row">
                                <div class="col-lg-12">
                                    <form id="fileupload" class="form-horizontal article" action="${base}/document/batchUpload-article_imgs.do" subaction="${base}/art/submit_edit_${type}.html" method="POST" enctype="multipart/form-data">
                                   		<input type="hidden" name="id" value="${(art.id)!''}"/>
                                   		<input type="hidden" name="gId" value="${(art.id)!''}"/>
                                   		<input type="hidden" name="fileModule" value="${type}"/>
                                   		<#if (art.id)?? >
	                                   		<div class="alert alert-warning"><strong>小贴士：</strong> 当前编辑模式中，【上传、删除】操作将是自动保存，请谨慎操作！</div>
                                   		</#if>
                                        <div class="form-group">
                                            <label for="nick" class="col-sm-1 control-label">图 片：</label>
                                            <div class="col-sm-11">
								                <div class="row fileupload-buttonbar batchUpload">
								                    <div class="col-sm-7">
								                        <!-- The fileinput-button span is used to style the file input field as button -->
								                        <span class="btn btn-success fileinput-button addFile">
								                            <i class="fa fa-plus"></i>
								                            <span>添加文件...</span>
								                            <input type="file" name="files" id="files" multiple accept="image/*">
								                        </span>
								                        <button type="submit" class="btn btn-primary start">
								                            <i class="fa fa-cloud-upload"></i>
								                            <span>开始上传</span>
								                        </button>
								                        <!-- <button type="reset" class="btn btn-warning cancel">
								                            <i class="fa fa-ban"></i>
								                            <span>取消上传</span>
								                        </button> -->
								                        <button type="button" class="btn btn-danger delete" id="deleteAll">
								                            <i class="fa fa-trash-o"></i>
								                            <span>删 除</span>
								                        </button>
								                        <label class="span control-label chklabel"><input type="checkbox" class="toggle"> 全 选</label>
								                    </div>
								                    <!-- The global progress information -->
								                    <div class="col-sm-5 fileupload-progress fade" id="fileupload-progress">
								                        <!-- The global progress bar -->
								                        <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
								                            <div class="bar progress-bar progress-bar-success" style="width:0%;"></div>
								                        </div>
								                        <!-- The extended global progress information -->
								                        <div class="progress-extended">&nbsp;</div>
								                        <br>
								                    </div>
								                </div>
								                <#include "/pager/biz-logic/include/batch_upload.html" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="nick" class="col-sm-1 control-label">视 频：</label>
                                            <div class="col-sm-4" style="width:380px;">
                                                <input type="file" name="videoUrlTmp" id="file_upload" />
                                                <input type="hidden" name="videoUrl" value="${(art.videoUrl)!''}"/>
                                            </div>
                                            <div class="col-sm-5" style="margin-left: -280px;line-height: 30px;">
                                               <a href="javascript:void(0)" id="href-filename" data-toggle="tooltip" data-placement="top" title="下载文件"></a>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="nick" class="col-sm-1 control-label">是否推荐：</label>
                                            <div class="col-sm-3">
                                                <select class="form-control" name="recommend" id="recommend">
                                                	<option value="0">不推荐</option>
                                                	<option value="1">推 荐</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="nick" class="col-sm-1 control-label">前端显示：</label>
                                            <div class="col-sm-3">
                                                <select class="form-control" name="spaceShow" id="spaceShow">
                                                	<option value="0">不显示</option>
                                                	<option value="1">显 示</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="nick" class="col-sm-1 control-label">标 题：<span style="color: #ff0000">*</span></label>
                                            <div class="col-sm-10">
                                                <input type="text" class="form-control" name="title" id="title"
                                                       value="${(art.title)!''}" maxlength="50"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="nick" class="col-sm-1 control-label">摘 要：</label>
                                            <div class="col-sm-10">
                                                <textarea style="height:100px" class="form-control" name="summary" maxlength="1000">${(art.summary)!''}</textarea>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="phone" class="col-sm-1 control-label">内 容：<span style="color: #ff0000">*</span></label>
                                            <div class="col-sm-10">
                                                <textarea name="content" id="content" class="form-control" style="visibility:hidden;height:510px">${(art.content)!''}</textarea>
                                            </div>
                                            <div class="col-sm-1 error-msg"><span class="msg-box n-right" for="content"></span></div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label"></label>
                                            <div class="col-sm-6">
                                            	<input type="button" class="btn btn-warning" id="close_btn" value="关 闭"/>
                                                <input type="submit" class="btn btn-primary" id="submit_btn" value="确认保存"/>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
    <#include "/pager/biz-logic/include/bot.ftl" />
</@compress>
